{extend name="public/base"}

{block name="title"}
交易明细
{/block}

{block name="style"}
{css href="/static/wechat/css/wallet.css" /}
{/block}

{block name="body"}
<div class="pageControl myBankCard">
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">我的银行卡</h1>
        <a class="msui_navTop-icon" href="{:url('save_bank', ['type' => $type, 'url' => 2])}"><i class="micon-add"></i></a>
    </div>
    <div class="weui-cells js-bank">
        {volist name="banks" id="vo"}
        <div class="msui_table msui_tableCom">
            <div class="msui_tabCell-img msui_tableImg-circle">
                {if condition="$vo.type eq 1"}
                <img src="../static/images/1.jpg">
                {elseif condition="$vo.type eq 2"}
                <img src="/static/wechat/images/1.jpg">
                {else /}
                <img src="{$vo.logo|get_img_url}">
                {/if}
            </div>
            <div class="msui_tabCell-content">
                <p class="fs085 cl-3333 js-bank">{$vo.bank_name}</p>
                <p class="fs085 cl-9999 js-number">{php}echo str_repeat(str_repeat('*', 4) . ' ', 3) . substr($vo['account'], -4);{/php}</p>
            </div>
            <div class="msui_tabCell-button">
                <a class="fs08 cl-6666 relieve" data-id="{$vo.id}">解除绑定</a>
            </div>
        </div>
        {/volist}
    </div>
</div>
{/block}

{block name="javascript"}
<script>
    $(function () {
        $(".relieve").click(function () {
            if (!confirm('确定解除银行卡绑定？')) {
                return false;
            }
            var _this = $(this);
            $.get('{:url("relieve")}', {bank_id : _this.data('id')}, function (msg) {
                if (msg.code == 200) {
                    alert('解除成功!')
                    window.location.reload();
                } else {
                    alert(error_code[msg.code]);
                }
            }, 'json');
        });
    });
</script>
{/block}
